<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">

        <div><?php include "../public_flow/flow_show_info.php";?></div>

        <div class="table-box tablenes">
            <div class="title">基本信息</div>
            <table class="layui-table">
                <tbody>

                <tr><td class="tt">工程名称</td><td id="enginname" class="colorlan tv" colspan="3"></td></tr>
                <tr><td class="tt">项目属性</td><td id="business_name" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">关联劳务合同</td><td id="caiid_name" class="tv colorlan" colspan="3"></td></tr>
                <tr><td class="tt">劳务合同编号</td><td id="caiid_number" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">班组名称</td><td id="gonger" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">班组负责人</td><td id="gonguser" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">备注</td><td id="explain" colspan="3" class="tv"></td></tr>

                </tbody>
            </table>
        </div>

        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo">成员信息</script>
            <div class="tableShow">
                <table id="datalist" lay-filter="datalist"></table>
            </div>
        </div>



        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_labour_hua_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                var engininfo = res.data.engininfo;
                var caiidinfo = res.data.caiidinfo;

                $("#enginname").text(engininfo.name).click(function () {
                    openPage('../engin/show.php?id='+engininfo.id);
                });

                $("#business_name").text(engininfo.business_name);
                $("#gonger").text(data.gonger);
                $("#gonguser").text(data.gonguser);
                $("#explain").text(data.explain);


                if(caiidinfo){
                    $("#caiid_name").text(caiidinfo.name).click(function () {
                        openPage('../contract_cai/show.php?id='+caiidinfo.id);
                    });
                    $("#caiid_number").text(caiidinfo.number);
                }



                var mytableList = table.render({
                    elem: "#datalist",data:res.data.list, toolbar: '#toolbarDemo', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号',fixed:'left'}
                        ,{field: 'place', title: '工种/岗位'}
                        ,{field: 'name', title: '姓名'}
                        ,{field: 'tel', title: '手机号'}
                        ,{field: 'sex', title: '性别'}
                        ,{field: 'age', title: '年龄'}
                        ,{field: 'idcard', title: '身份证号'}
                        ,{field: 'addr', title: '家庭地址'}
                        ,{field: 'banname', title: '班组名称'}
                        ,{field: 'jindt', title: '进场日期'}
                        ,{field: 'tuidt', title: '退场日期'}
                        ,{field: 'jian', title: '健康状况'}
                        ,{field:'',title:'身份证',templet: function(d){
                                if(d.file_shen_arr.length > 0){

                                    return '<span class="colorlan" onclick="openTabFilePage(\'file_shen'+d.id+'\')">' +
                                        '<span class="layui-hide file_shen'+d.id+'">'+JSON.stringify(d.file_shen_arr)+'</span>' +
                                        '<i class="layui-icon layui-icon-link"></i>' +
                                        '</span>';
                                }
                                return '';
                            }}
                        ,{field:'',title:'合同情况',templet: function(d){
                                if(d.file_he_arr.length > 0){

                                    return '<span class="colorlan" onclick="openTabFilePage(\'file_he'+d.id+'\')">' +
                                        '<span class="layui-hide file_he'+d.id+'">'+JSON.stringify(d.file_he_arr)+'</span>' +
                                        '<i class="layui-icon layui-icon-link"></i>' +
                                        '</span>';
                                }
                                return '';
                            }}
                        ,{field:'',title:'上岗证书',templet: function(d){
                                if(d.file_gang_arr.length > 0){

                                    return '<span class="colorlan" onclick="openTabFilePage(\'file_gang'+d.id+'\')">' +
                                        '<span class="layui-hide file_gang'+d.id+'">'+JSON.stringify(d.file_gang_arr)+'</span>' +
                                        '<i class="layui-icon layui-icon-link"></i>' +
                                        '</span>';
                                }
                                return '';
                            }}
                        ,{field:'',title:'退场确认书',templet: function(d){
                                if(d.file_book_arr.length > 0){

                                    return '<span class="colorlan" onclick="openTabFilePage(\'file_book'+d.id+'\')">' +
                                        '<span class="layui-hide file_book'+d.id+'">'+JSON.stringify(d.file_book_arr)+'</span>' +
                                        '<i class="layui-icon layui-icon-link"></i>' +
                                        '</span>';
                                }
                                return '';
                            }}
                        ,{field: 'explain', title: '备注'}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });

                // $(".pageshowtitle").text('项目花名册');

                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('labour_hua', param_id);
        showpage_dropopt();
    });



</script>
</body>
</html>




